package homework.day4;

import java.io.*;
import java.util.Scanner;

/**
 * 改错
 *
 * 程序实现的是简易记事本工具。程序启动后向pw.txt文件写内容
 * 用户输入的每一行字符串都写入到文件中，单独输入exit时
 * 程序退出。
 *
 * @author cominam
 *
 */

public class Test4 {
    public static void main(String[] args) throws FileNotFoundException {
        FileOutputStream fos = new FileOutputStream("./scr/homework/day4/pw.txt");
        OutputStreamWriter osw = new OutputStreamWriter(fos);
        BufferedWriter bw = new BufferedWriter(osw);
        PrintWriter pw = new PrintWriter(bw);

        Scanner scanner = new Scanner(System.in);

        while (true){
            System.out.println("请输入文本");
            String line = scanner.nextLine();
            pw.println();
        }
    }
}
